<?php
	require_once('Sqlite/DB.php');
	$db = openDB('Sqlite/myDatabase');
?>

<div class="buscador">
	<a>buscador de Motos</a>
	<form action="index.php">
		<input type="hidden" name="p" value="busqueda"/>
		<select name="Marca">			
			<option value="Marca" selected="selected">Marca</option>
			<?php
				$table=queryDB($db,"SELECT DISTINCT Marca FROM Motos");
				while($row=getRow($table)){
					if(!empty($row['Marca']))
						echo '<option value="'. $row['Marca'].'">'.$row['Marca'].'</option>';	
				}
			?>
		</select>
		<select name="Modelo">
			<option value="Modelo" selected="selected">Modelo</option>
			<?php
				$table=queryDB($db,"SELECT DISTINCT Modelo FROM Motos");
				while($row=getRow($table)){
					if(!empty($row['Modelo']))
						echo '<option value="'. $row['Modelo'].'">'.$row['Modelo'].'</option>';	
				}
			?>
		</select>		
		<input type="submit" value="buscar" id="botonBuscar"></input>
		
	</form>
	<a href="index.php?p=busquedaAvanzada" class="busqedaAvanz"><span><img src="img/flechas.png" alt=">>"></img></span>Busqueda avanzada</a>
</div>

